Skip to content

[PWGHF] Added safety checks before using ccdb efficiency objects#15653

Merged
apalasciano merged 2 commits intoAliceO2Group:masterfrom
deependra170598:hfc-pT-efficiency-check
Apr 5, 2026
Merged

[PWGHF] Added safety checks before using ccdb efficiency objects#15653
apalasciano merged 2 commits intoAliceO2Group:masterfrom
deependra170598:hfc-pT-efficiency-check

Conversation

@deependra170598
Copy link
Copy Markdown
Contributor

Hi @singhra1994, @apalasciano and @gluparel,

Could you please review this PR?

In this PR, I tried to add safety checks before using ccdb efficiency object so that NAN dose not propagate to the THnSparse.

Let me know you any suggestion or improvement needed, Thanks.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 5, 2026

O2 linter results: ❌ 0 errors, ⚠️ 1 warnings, 🔕 0 disabled

@apalasciano apalasciano merged commit a161052 into AliceO2Group:master Apr 5, 2026
12 of 13 checks passed
@vkucera
Copy link
Copy Markdown
Collaborator

vkucera commented Apr 6, 2026

@deependra170598 Please fix the documentation in your next PR.

efficiencyWeightTracks = vecHistEfficiencyTracks[0]->GetBinContent(1);
} else {
efficiencyWeightTracks = vecHistEfficiencyTracks[0]->GetBinContent(vecHistEfficiencyTracks[0]->GetXaxis()->FindBin(ptTrack));
if (!efficiencyWeightTracks) {
Copy link
Copy Markdown
Collaborator

@vkucera vkucera Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is wrong. You convert float to bool and compare it to false. For that to happen, the float would have to be exactly 0 which almost never happens if the value is a result of a calculation. Furthermore, the syntax signals the intention of using a bool value which is not the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pwghf PWG-HF

Development

Successfully merging this pull request may close these issues.

3 participants